// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .CS}

//-------------MAIN---------------
thread 'TORIC'




:create_guards
VAR
0@:INT
1@ :INT
14@:INT
18@:INT 
END
    Model.Load(#AK47)                                                                                                                                                                                                                                
    Model.Load(#COLT45)                                                                                                                                                                                                                                  
    Model.Load(#MP5LNG)
    Model.Load(#M4)
    Model.Load(#MICRO_UZI)
    Model.Load(#grenade) 
    Model.Load(#sniper)
    Model.Load(#heatseek)
    Model.Load(#rocketla)
    Model.Load(#flame)
    Model.Load(#minigun)
    Model.Load(#spraycan)
    Model.Load(#tec9)
    Model.Load(#shotgspa)
    Model.Load(#chromegun) 
    Model.Load(#molotov)
    Model.Load(#BAT)
    Model.Load(#KNIFECUR)
038B: load_requested_models 

15@ = 1
14@ = 10

GOSUB @DELETE_GUARDS
21@ = -25.0 
22@ = 30.0 
23@ = 30.0 
24@ = 24.0
26@ = 1.0
0AB4: 14@ > 318 
0085: 18@ = 14@
18@ -= 1

for 0@ = 0 to 18@ step 1
    1@ = 0@
    1@ *= 4
    WAIT 50
                                   
    0208: 25@ = random_float_in_ranges 21@ 22@                                                   
    04C4: store_coords_to 27@ 28@ 29@ from_actor $PLAYER_ACTOR with_offset 25@ 26@ -1.0           
    //04D3: get_nearest_car_path_coords_from 27@ 28@ 29@ type 2 store_to 27@ 28@ 29@
    0AB4: 9@ > 320 
    gosub @get_model
    Model.Load(7@)
    038B: load_requested_models
    2@ = Actor.Create(Gang2, 7@, 27@, 28@, 29@)                                   
    Actor.Angle(2@) = 88.36082
    0AB4: 15@ > 317                                                       
    GOSUB @GET_WEAPON_ID                                                        
    Actor.GiveWeaponAndAmmo(2@, 16@, 1E12)                                            
    3@ = Marker.CreateAboveActor(2@)                                              
    018B: set_marker 3@ radar_mode 2
    Actor.SetImmunities(2@, 0, 1, 0, 1, 0)
    07DD: set_actor 2@ attack_rate 100 // previously known as temper_to
    0446: set_actor 2@ dismemberment_possible 0
    07CB: set_actor 2@ supporting_fire 1
    060B: set_actor 2@ decision_maker_to 2
    for 30@ = 4 to 22 step 1
        if 056D:   actor 2@ defined
        jf continue
        if not 30@ == 8
        jf continue
        077A: set_actor 2@ acquaintance 4 to_actors_pedtype 30@ 
    end              
    Actor.Health(2@) = 2000                                                          
    Actor.WeaponAccuracy(2@) = 90                                                    
    0AC6: 10@ = label @A1_M_H_INDEX offset                                                                                                                                                                                                 
    005A: 10@ += 1@                                                                                                                                                                                                                    
    0A8C: write_memory 10@ size 4 value 2@ virtual_protect 0
    0302: show_text_4numbers GXT 'kGATTAN' numbers 0@ 18@ 0 0 time 50 flag 1  // DUAS RODAS - BNUS DUPLO: $ ~1~ Distncia: ~1~m Tempo: ~1~ segundos
    26@ += 1.0
END

:loop
while true
    wait 0
    0ab4: 0@ 773
    if 0@ == 1
    then goto @DELETE_GUARDS2
    end 
    if 0@ == 2
    then goto @guards_follow
    end  
end

:GET_WEAPON_ID
if 15@ == 1 //LOW
then 
    0209: 19@ = random_int_in_ranges 1 3
    IF 19@ == 1
    THEN 16@ = 4 //KNIFE
    ELSE
        IF 19@ == 2
        THEN 16@ = 5 //BAT
        ELSE
            IF 19@ == 3
            THEN 16@ = 41 //SPRAYCAN
            END
        END
    END
END
if 15@ == 2 //NORMAL
then 
    0209: 19@ = random_int_in_ranges 1 3
    IF 19@ == 1
    THEN 16@ = 22 //PISTOL
    ELSE
        IF 19@ == 2
        THEN 16@ = 28 //MICRO UZI
        ELSE
            IF 19@ == 3
            THEN 16@ = 32 //TEC 9
            END
        END
    END
END
if 15@ == 3 //STRONG
then 
    0209: 19@ = random_int_in_ranges 1 7
    IF 19@ == 1
    THEN 16@ = 29 //PISTOL
    ELSE
        IF 19@ == 2
        THEN 16@ = 30 //MICRO UZI
        ELSE
            IF 19@ == 3
            THEN 16@ = 31 //TEC 9
            ELSE
                IF 19@ == 4
                THEN 16@ = 16 //TEC 9
                ELSE
                    IF 19@ == 5
                    THEN 16@ = 18 //TEC 9
                    ELSE
                        IF 19@ == 6                              
                        THEN 16@ = 25 //TEC 9           
                        ELSE                                    
                            IF 19@ == 7                              
                            THEN 16@ = 27 //TEC 9           
                            END
                        END
                    END
                END
            END                                    
        END             
    END
END
if 15@ == 4 //EXTREME
then 
    0209: 19@ = random_int_in_ranges 1 6
    IF 19@ == 1
    THEN 16@ = 35 //PISTOL
    ELSE
        IF 19@ == 2
        THEN 16@ = 36 //MICRO UZI
        ELSE
            IF 19@ == 3
            THEN 16@ = 37 //TEC 9
            ELSE
                IF 19@ == 4
                THEN 16@ = 38 //TEC 9
                ELSE
                    IF 19@ == 5
                    THEN 16@ = 31 //TEC 9
                    ELSE
                        IF 19@ == 6                              
                        THEN 16@ = 34 //TEC 9           
                        END
                    END
                END
            END                                    
        END             
    END
END                                
RETURN        
        
:get_model
        if 9@ == 1                                                                                
        then //0acd: "00000000000" 100                                                                                           
            0209: 7@ = random_int_in_ranges 105 107                                            
        end                                                                                                                                                                    
        if 9@ == 2                                                                                                         
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 102 104                                            
        end                                                                                                                                                                    
        if 9@ == 3                                                                                                        
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 108 110                                            
        end                                                                                                                                                                    
        if 9@ == 4                                                                                                         
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 114 116                                            
        end                                                                                                                                                                    
        if 9@ == 5                                                                                                        
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 280 286                                            
        end                                                                                                                                                                    
        if 9@ == 6                                                                                                        
        then                                                                                                                     
            0209: 12@ = random_int_in_ranges 1 9                                                 
            if                                                                                       
              12@ == 1                                                                           
            then                                                                                     
            7@ = 63                                                                            
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 2                                                                           
            then                                                                                     
            7@ = 152                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 3                                                                           
            then                                                                                     
            7@ = 237                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 4                                                                           
            then                                                                                     
            7@ = 207                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 5                                                                           
            then                                                                                     
            7@ = 238                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 6                                                                           
            then                                                                                     
            7@ = 245                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 7                                                                           
            then                                                                                     
            7@ = 243                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 8                                                                           
            then                                                                                     
            7@ = 178                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 9                                                                           
            then                                                                                     
            7@ = 178                                                                           
                                                                                                     
            end                                                                                      
        end                                                                                          
        if 9@ == 7                                                                                                        
        then                                                                                                                     
            0209: 12@ = random_int_in_ranges 1 6                                                 
            if                                                                                       
              12@ == 1                                                                           
            then                                                                                     
            7@ = 87                                                                            
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 2                                                                           
            then                                                                                     
            7@ = 244                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 3                                                                           
            then                                                                                     
            7@ = 246                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 4                                                                           
            then                                                                                     
            7@ = 256                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 5                                                                           
            then                                                                                     
            7@ = 257                                                                           
                                                                                                     
            end                                                                                      
            if                                                                                       
              12@ == 6                                                                           
            then                                                                                     
            7@ = 257                                                                           
                                                                                                     
            end                                                                                      
        end                                                                                          
        if 9@ == 8                                                                                                        
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 117 118                                            
        end                                                                                                                                                                    
        if 9@ == 9                                                                                                        
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 173 175                                            
                                                                                                                                                                               
        end                                                                                                                                                          
        if 9@ == 10                                                                                                       
        then                                                                                                                     
            0209: 7@ = random_int_in_ranges 121 123                                            
        END                                                  
        return        
                                                                 
               


:DELETE_GUARDS        
for 0@ = 0 to 80 step 1
    1@ = 0@
    1@ *= 4
    //------------------------------------------------------------              
    0AC6: 10@ = label @A1_M_H_INDEX offset                            
    005A: 10@ += 1@                                               
    0A8d: 2@ 10@  4  0                                    
    //------------------------------------------------------------              
    if 056D:   actor 2@ defined
    then  Actor.RemoveReferences(2@)
    ACTOR.DestroyInstantly(2@)
    0A8C: write_memory 10@ size 4 value -1 virtual_protect 0  
    END                                      
end
return
END_THREAD



:DELETE_GUARDS2        
for 0@ = 0 to 80 step 1
    1@ = 0@
    1@ *= 4
    //------------------------------------------------------------              
    0AC6: 10@ = label @A1_M_H_INDEX offset                            
    005A: 10@ += 1@                                               
    0A8d: 2@ 10@  4  0                                    
    //------------------------------------------------------------              
    if 056D:   actor 2@ defined
    then  
        Actor.RemoveReferences(2@)
        ACTOR.DestroyInstantly(2@)
        0A8C: write_memory 10@ size 4 value -1 virtual_protect 0  
    END                                      
end
0ab3: 773 > 0
end_thread

:guards_follow
0@ = 0
WHILE TRUE
    WAIT 0
    INC(0@)                   
    IF 0@ >= 80               
    THEN 0@ = 0               
       BREAK                     
    END                          
    1@ = 0@
    1@ *= 4
    //------------------------------------------------------------              
    0AC6: 10@ = label @A1_M_H_INDEX offset                            
    005A: 10@ += 1@                                               
    0A8d: 2@ 10@  4  0                                    
    //------------------------------------------------------------              
    if 056D:   actor 2@ defined
    then 
        IF NOT ACTOR.Dead(2@)
        THEN
            0850: AS_actor 2@ follow_actor $PLAYER_ACTOR
            0ACD: "follow cj Seting" 100
        END
    END
END
0ab3: 773 > 0
goto @loop    

:A1_M_H_INDEX //HANDLER MEMORY
hex
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
end




